﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MensUnoShop.Models;

namespace MensUnoShop.Areas.Admin.Models
{
    public class ManagerMarketFactory
    {
        public static void GetManagerMarketChoiceList(string id, out List<string[]> outlist, out List<string[]> inlist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DAL.DALMarket dbm = new DAL.DALMarket();
                dbm.GetManagerMarketChoiceList(tid, out outlist, out inlist);
            }
            else
            {
                outlist = new List<string[]>();
                inlist = new List<string[]>();
            }
        }

        public static bool SetManagerMarketChoiceIn(string id, string[] mklist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DAL.DALMarket dbm = new DAL.DALMarket();
                return dbm.SetManagerMarketChoiceIn(tid, mklist);
            }
            return false;
        }

        public static bool SetManagerMarketChoiceOut(string id, string[] mklist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DAL.DALMarket dbm = new DAL.DALMarket();
                return dbm.SetManagerMarketChoiceOut(tid, mklist);
            }
            return false;
        }

        public static void GetManagerTagAppointList(string id, out List<UTag> outlist, out List<UTag> inlist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DBTag dbt = new DBTag();
                dbt.GetManagerTagAppointList(tid, out outlist, out inlist);
            }
            else
            {
                outlist = new List<UTag>();
                inlist = new List<UTag>();
            }
        }

        public static bool SetManagerTagAppointIn(string id, string[] tidlist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DBTag dbt = new DBTag();
                return dbt.SetManagerTagAppointIn(tid, tidlist);
            }
            return false;
        }

        public static bool SetManagerTagAppointOut(string id, string[] tidlist)
        {
            int tid;
            if (int.TryParse(id, out tid))
            {
                DBTag dbt = new DBTag();
                return dbt.SetManagerTagAppointOut(tid, tidlist);
            }
            return false;
        }
    }
}